package com.fjh.feign;

import com.fjh.domain.Sku;
import com.fjh.feign.hystrix.OrderProductFeignHystrix;
import com.fjh.model.StockChange;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
@FeignClient(value = "product-service",fallback = OrderProductFeignHystrix.class)
public interface OrderProductFeign {
    /**
     * 根据skuIds查询sku集合
     * @param skuIds
     * @return
     */
    @PostMapping("prod/prod/getSkuListByIds")
    List<Sku> getSkuListByIds(@RequestBody List<Long> skuIds);

    /**
     * 发起远程调用   修改mysql的库存
     * @param stockChange
     */
    @PostMapping("prod/prod/changesStock")
    void changeStock(@RequestBody StockChange stockChange);
}
